package com.solute.web.main.index.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.solute.domain.CodeVO;
import com.solute.utils.services.CodeService;
import com.solute.web.main.index.dao.MainIndexDao;

@Service
public class MainIndexService {
	
	private static final String LANGUAGE_TAG[] = {"언어", "language", "한국어"};
	private static final String MATH_TAG[] = {"수리", "수학", "math", "mathmetica"};
	private static final String ENGLISH_TAG[] = {"외국어", "영어", "english"};
	private static final String SCIENCE_TAG[] = {"과탐", "science", "과학", "물리", "화학"};
	private static final String SOCIETY_TAG[] = {"사탐", "society", "사회"};
	
	private @Autowired CodeService codeService;
	
	private @Autowired MainIndexDao dao;
	
	
	public Map<String, Integer> getNumSolutions() {
		Map<String, Integer> cnts = new HashMap<String, Integer>();
		
		cnts.put("language", dao.getNumSolutionByTag(LANGUAGE_TAG));
		cnts.put("math", dao.getNumSolutionByTag(MATH_TAG));
		cnts.put("english", dao.getNumSolutionByTag(ENGLISH_TAG));
		cnts.put("science", dao.getNumSolutionByTag(SCIENCE_TAG));
		cnts.put("society", dao.getNumSolutionByTag(SOCIETY_TAG));
		
		return cnts;
	}
}
